package cn.jsu.oj.dispatchServer.satellite.pojo.net;

import io.netty.channel.Channel;

import java.io.Serializable;

/**
 * @author ahtonc
 */
public class PackNet<T> implements Serializable {
    
    private String identity;
    private Channel channel;
    private T message;

    public PackNet() {
    }

    public PackNet(T message) {
        this.message = message;
    }

    public PackNet(Channel channel, T message) {
        this.channel = channel;
        this.message = message;
    }

    public PackNet(String identity, Channel channel, T client) {
        this.identity = identity;
        this.channel = channel;
        this.message = client;
    }
    
    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    public T getMessage() {
        return message;
    }

    public void setMessage(T message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "PackNet{" +
                "identity='" + identity + '\'' +
                ", channel=" + channel +
                ", client=" + message +
                '}';
    }
}
